package com.wbs.shop.nuby.helper;

import com.wbs.shop.nuby.bean.GoodsBean;
import com.wbs.shop.nuby.bean.GoodsShowBean;
import com.wbs.shop.nuby.bean.SpecBean;

/**
 * Created by zhoucl on 2018/6/14 0014.
 */
public class CashierHelper {
    public static GoodsShowBean goodsTOGoodsShow(GoodsBean goodsBean, int number) {
        return goodsTOGoodsShow(goodsBean, null, number);
    }

    public static GoodsShowBean goodsTOGoodsShow(GoodsBean goodsBean, SpecBean specBean, int number) {
        GoodsShowBean goodsShowBean = new GoodsShowBean();
        goodsShowBean.setId(goodsBean.getId());
        goodsShowBean.setImgUrl(goodsBean.getImgUrl());
        goodsShowBean.setName(goodsBean.getName());
        goodsShowBean.setPrice(goodsBean.getPrice());
        goodsShowBean.setQuantity(number);
        if (specBean != null) {
            goodsShowBean.setBottomName(specBean.getSpecName());
            goodsShowBean.setSpecId(specBean.getId());
            goodsShowBean.setPrice(specBean.getPrice());
        }
        return goodsShowBean;
    }
}
